package com.globallogic.week3.util;

import java.util.regex.Pattern;

public class Validator {


	
	private static final String LOGIN_PATTERN = "^[a-zA-Z0-9_-]{3,15}$";
	private static final String PASS_PATTERN = "((?=.*\\d)(?=.*[a-z]).{6,20})";
	
	
	public static boolean validateLogin(String login){
		return Pattern.matches(LOGIN_PATTERN, login);
	}
	
	public static boolean validatePass(String pass){
		return Pattern.matches(PASS_PATTERN, pass);
	}
	
	public static boolean comparePasswords(String pass, String conPass){
		return pass.equals(conPass);
	}
}
